import request from "@/utils/request";
// 菜单基础URL

const OrderApi = {
  /**
   *
   * @returns 订单列表
   */
  getOrders(queryParams: any) {
    return request<any>({
      url: "order/list",
      method: "get",
      params: queryParams,
    });
  },
  //新增订单
  orderAdd(data: any) {
    return request<any>({
      url: "order/add",
      method: "post",
      data: data,
    });
  },
  sendDriver(data: any) {
    return request<any>({
      url: "order/assignDriver",
      method: "post",
      data: data,
    });
  },

  sendSupplier(data: any) {
    return request<any>({
      url: "order/assignSupplier",
      method: "post",
      data: data,
    });
  },
  //外派司机
  sendDriverOut(data: any) {
    return request<any>({
      url: "order/assignOut",
      method: "post",
      data: data,
    });
  },
  //订单日志
  getLogs(queryParams: any) {
    return request<any>({
      url: "orderTrace/list",
      method: "get",
      params: queryParams,
    });
  },
  //加入抢单池
  orderPoolIn(data: any) {
    return request<any>({
      url: "order/orderPoolIn",
      method: "post",
      data: data,
    });
  },
  //移出抢单池
  orderPoolOut(data: any) {
    return request<any>({
      url: "order/orderPoolOut",
      method: "post",
      data: data,
    });
  },
  //抢单
  catchOrder(data: any) {
    return request<any>({
      url: "order/catchOrder",
      method: "post",
      data: data,
    });
  },
  //回收订单
  orderReclaim(data: any) {
    return request<any>({
      url: "order/orderReclaim",
      method: "post",
      data: data,
    });
  },
  //更改司机状态
  updateDriverStatus(data: any) {
    return request<any>({
      url: "order/driverStatus",
      method: "post",
      data: data,
    });
  },
  //完成订单
  orderComplete(data: any) {
    return request<any>({
      url: "order/orderComplete",
      method: "post",
      data: data,
    });
  },
  //退回渠道
  orderCancel(data: any) {
    return request<any>({
      url: "order/orderCancel",
      method: "post",
      data: data,
    });
  },
  //订单作废
  orderInvalid(data: any) {
    return request<any>({
      url: "order/orderInvalid",
      method: "post",
      data: data,
    });
  },
  //奖励||罚款
  orderReward(data: any) {
    return request<any>({
      url: "wallet/reward",
      method: "post",
      data: data,
    });
  },
  //评价列表
  rateList(queryParams: any) {
    return request<any>({
      url: "orderRate/list",
      method: "get",
      params: queryParams,
    });
  },
  //发票列表
  invoiceList(queryParams: any) {
    return request<any>({
      url: "invoice/list",
      method: "get",
      params: queryParams,
    });
  },
  //开票
  invoiceCreate(data: any) {
    return request<any>({
      url: "invoice/create",
      method: "post",
      data: data,
    });
  },
  //重开
  invoiceRcreate(data: any) {
    return request<any>({
      url: "invoice/recreate",
      method: "post",
      data: data,
    });
  },
  //红冲
  redInvoice(data: any) {
    return request<any>({
      url: "invoice/redInvoice",
      method: "post",
      data: data,
    });
  },
  //重开
  resendInvoice(data: any) {
    return request<any>({
      url: "invoice/resendInvoice",
      method: "post",
      data: data,
    });
  },
  //保险管理
  insuranceList(queryParams: any) {
    return request<any>({
      url: "insurance/list",
      method: "get",
      params: queryParams,
    });
  },
  //询价记录
  statEstimateList(queryParams: any) {
    return request<any>({
      url: "estimateRecord/list",
      method: "get",
      params: queryParams,
    });
  },
  //事件列表
  eventList(queryParams: any) {
    return request<any>({
      url: "event/list",
      method: "get",
      params: queryParams,
    });
  },
  //订单统计
  getOrderCount() {
    return request<any>({
      url: "order/orderStat",
      method: "get",
    });
  },
  //获取轨迹
  getLocation(queryParams: any) {
    return request<any>({
      url: "order/location",
      method: "get",
      params: queryParams,
    });
  },
  //事件回复列表详情
  getEventDetail(queryParams: any) {
    return request<any>({
      url: "event/eventDetail",
      method: "get",
      params: queryParams,
    });
  },
  //事件回复
  eventReply(data: any) {
    return request<any>({
      url: "event/reply",
      method: "post",
      data: data,
    });
  },
};

export default OrderApi;
